home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
U-Utilities
/
(c)u2.d64
/
4040 commands.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
5KB
|
145 lines
0 REM**********************************
1 REM
2 REM C64 4040 DISK COMMANDS
3 REM IEEE INTERFACE IS REQUIRED
4 REM
5 REM DAVID BYRUM
6 REM 3301 E. FT. LOWELL RD
7 REM TUCSON, AZ 85716 / 795-2928
8 REM
9 REM**********************************
100 POKE 53280,4:POKE 53281,6:POKE 788,52:PRINT CHR$(14):GOSUB10000
110 PRINT"[147][144]********** [129]4040 DISK COMMANDS[144] **********"
120 PRINTTAB(5)"[144][198] 1 [158]= [196]UPLICATE [196]ISK ([196]1 = [196]0)"
125 PRINTTAB(5)"[144][198] 2 [158]= [195]OPY A FILE FROM [196]0 TO [196]1"
130 PRINTTAB(5)"[144][198] 3 [158]= [201]NITIALIZE A [196]RIVE"
135 PRINTTAB(5)"[144][198] 4 [158]= [214]ALIDATE A [196]ISK"
140 PRINTTAB(5)"[144][198] 5 [158]= [196]ISK [196]IRECTORY"
145 PRINTTAB(5)"[144][198] 6 [158]= [198]ORMATE [196]ISK IN [196]RIVE 1"
150 PRINTTAB(5)"[144][198] 7 [158]= [196]ETERMINE [196]ISK [197]RROR"
155 PRINTTAB(5)"[144][198] 8 [158]= [210]ENAME A FILE"
170 PRINT"[144][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"
200 GETZ$:IF Z$="" THEN 200
210 IF Z$="[133]" THEN GOSUB 1000 :REM F1 - DUPLICATE DISK (D1=D0)
215 IF Z$="[137]" THEN GOSUB 1500 :REM F2 - COPY A FILE FROM D0 TO D1
220 IF Z$="[134]" THEN GOSUB 2500 :REM F3 - INITIALIZE DRIVE 0
225 IF Z$="[138]" THEN GOSUB 2000 :REM F4 - VALIDATE D1 DISK
230 IF Z$="[135]" THEN GOSUB 3000 :REM F5 - DISK (null)
235 IF Z$="[139]" THEN GOSUB 3500 :REM F6 - FORMATE NEW D1 DISK
240 IF Z$="[136]" THEN GOSUB 4000 :REM F7 - DETERMINE DISK ERROR
250 IF Z$="[140]" THEN GOSUB 4500 :REM F8 - RENAME A FILE
260 IF Z$="" THEN GOSUB 5000 :REM CONTROL S - SCRATCH A PROGRAM
270 IF Z$="" THEN 9000 :REM CONTROL Q - QUIT PROGRAM
290 GOTO 110
1000 REM ----- BACKUP D0 TO D1 --------
1010 POKE 214,23:PRINT"[145][129] [196]UPLICATING [196]ISK IN [144][196]RIVE 0[144] [129]TO [144][196]RIVE 1"
1020 OPEN 15,8,15
1030 PRINT#15,"D1=0":GOSUB 4020
1040 CLOSE 15
1050 RETURN
1500 REM ------- COPY A FILE ----------
1510 POKE 214,23:INPUT"[145][129][208]ROGRAM TO BE COPIED [154]";PG$
1515 PRINT"[145] "
1520 PRINT"[145][129] [195][207][208][217][201][206][199][160][155]";PG$;"[129] TO [196]1"
1530 OPEN 15,8,15
1540 PRINT#15,"C1:"+PG$+"=0:"+PG$:GOSUB 4020
1550 CLOSE 15
1560 RETURN
2000 REM -------- VALIDATE ------------
2005 POKE 214,23:INPUT"[145][129][213]SING [196][210][201][214][197] [144]0[129] OR [144]11[157][157][157][159]";DR$
2010 PRINT"[145] [129][214]ALIDATING [196]ISK IN [144][196]RIVE ";DR$
2020 OPEN 15,8,15
2030 PRINT#15,"V"+DR$:GOSUB 4020
2040 CLOSE 15
2050 RETURN
2500 REM ------- INITIALIZE------------
2505 POKE 214,23:INPUT"[145][129][213]SING [196][210][201][214][197] [144]0[129] OR [144]10[157][157][157][159]";DR$
2510 PRINT"[145] [129][201]NITIALIZING [144][196]RIVE "DR$
2520 OPEN 15,8,15
2530 PRINT#15,"I"+DR$:GOSUB 4020
2540 CLOSE 15
2550 RETURN
3000 REM ------- DIRECTORY ------------
3010 POKE 214,23:INPUT"[145][129][213]SING [196][210][201][214][197] [144]0[129] OR [144]11[157][157][157][159]";DR
3020 PRINT"[145] "
3030 IF DR<>0 AND DR<>1 THEN3010
3040 IF DR=0 THEN POKE 839,48:SYS 828:IF E>19 THEN3080
3050 IF DR=1 THEN POKE 839,49:SYS 828:IF E>19 THEN3080
3060 PRINTTAB(6)"[144][208]RESS [210]ETURN[144] FOR MENU"
3070 GETZ$:IF Z$<>CHR$(13) THEN3070
3080 RETURN
3500 REM ------- NEW HEADER -----------
3510 DH$="":POKE 214,23:INPUT"[145][129][196]ISK [200][197][193][196][197][210] [144]";DH$:DH$=LEFT$(DH$,16)
3520 PRINT"[145] "
3530 IF DH$="" THEN DH$="NEW DISK"
3540 POKE 214,23:PRINTTAB(9)"[145][129] [198][207][210][205][193][212][201][206][199] [193] [206][197][215][160][196][201][211][203]"
3550 OPEN 15,8,15
3560 ID=INT(RND(TI)*100):ID$=STR$(ID)
3570 PRINT#15,"N1:"+DH$+","+ID$:GOSUB4020
3580 CLOSE 15
3590 RETURN
4000 REM ------- DISK ERROR -----------
4010 OPEN 15,8,15
4020 INPUT#15,E,E$
4025 IF Z$="[136]" THEN 4040
4030 IF E<20 THEN 4080
4040 POKE 214,23:PRINT"[145] "
4050 PRINT"[145] [196]ISK ERROR [129]";E;"[144]- [129]";E$
4060 PRINTTAB(6)"[144][208]RESS [152][210]ETURN[144] TO CONTINUE[145]"
4070 GETZ$:IF Z$<>CHR$(13) THEN4070
4080 CLOSE 15:RETURN
4500 REM ----- RENAME A FILE ----------
4510 POKE 214,23:INPUT"[145][129][213]SING [196][210][201][214][197] [144]0[129] OR [144]11[157][157][157][159]";DR$
4520 PRINT"[145] "
4530 IF DR$<>"0" AND DR$<>"1" THEN4510
4540 INPUT"[145][129][207]LD [198]ILE [206]AME [159]";OF$
4550 INPUT"[129][206]EW [198]ILE [206]AME [144]";NF$
4560 PRINT"[145][145] "
4570 PRINT" "
4580 POKE 214,23:PRINT"[145][129][210]ENAMING [159]";OF$;"[129] TO [144]";NF$
4590 OPEN 15,8,15
4600 PRINT#15,"R"+DR$+":"+NF$+"="+OF$:GOSUB4020
4610 CLOSE 15
4620 RETURN
5000 REM ----- SCRATCH A FILE ---------
5010 POKE 214,23:INPUT"[145][129][213]SING [196][210][201][214][197] [144]0[129] OR [144]11[157][157][157][159]";DR$
5020 PRINT"[145] "
5030 IF DR$<>"0" AND DR$<>"1" THEN4510
5040 INPUT"[145][129][211]CRATCH [198]ILE [159]";SF$
5060 PRINT"[145] "
5080 POKE 214,23:PRINT"[145][129][211]CRATCHING [159]";SF$
5090 OPEN 15,8,15
5100 PRINT#15,"S"+DR$+":"+SF$:GOSUB4020
5110 CLOSE 15
5120 RETURN
9000 REM ------ QUIT PROGRAM ----------
9010 CLOSE 15
9020 POKE 214,23:PRINTTAB(6)"[145][197]ND OF [208]ROGRAM.... [129][199]OODBYE.[144][145][145]":POKE 788,49:END
10000 REM----- M.L. DIRECTORY ---------
10010 PRINT"[147]";TAB(7)"[129][197]NABLING [159][201]NVISIBLE [196]IRECTORY[154]"
10020 FOR I = 828 TO 971:READ A:POKE I,A:T=T+A:NEXT
10030 IF T<>19610 THEN PRINT"ERROR IN DATA STATEMENTS[146][154]":END
10040 IF PEEK(65440)=135 THEN POKE 924,189:REM USE ,221 ON VIC
10045 RETURN
10050 DATA 169,1,32,195,255,169,36
10060 DATA 141,240,3,169,48,141,241
10070 DATA 3,169,1,162,8,160,0
10080 DATA 32,186,255,169,2,162,240
10090 DATA 160,3,32,189,255,32,192
10100 DATA 255,169,64,32,144,255,162
10110 DATA 1,32,198,255,32,144,255
10120 DATA 32,207,255,32,207,255,32
10130 DATA 207,255,32,207,255,201,0
10140 DATA 240,58,32,204,255,32,228
10150 DATA 255,201,32,208,3,32,196
10160 DATA 3,162,1,32,198,255,32
10170 DATA 207,255,168,32,207,255,72
10180 DATA 152,170,104,32,205,221,169
10190 DATA 32,32,210,255,32,207,255
10200 DATA 201,0,208,8,169,13,32
10210 DATA 210,255,76,115,3,32,210
10220 DATA 255,76,162,3,169,1,32
10230 DATA 195,255,32,204,255,169,204
10240 DATA 133,178,96,32,228,255,201
10250 DATA 32,208,249,96